home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / alv.sun / alv.lha / doc / tutorial.ms < prev   
Encoding:
Text File  |  1992-11-08  |  3.5 KB  |  98 lines

  1. .SH 
  2. utorial
  3. .LP
  4. his is a short simple tutorial to (hopefully) show you how to use the
  5. LV toolkit commands and also how to interface to the toolkit when
  6. riting your own programs. A sample image is included in the
  7. istribution and this will be used to demonstrate a few of the
  8. oolkit's facilities.
  9. .LP
  10. First of all, decode the sample image, which has been encoded to permit
  11. ts transfer via email.
  12. .DS L
  13. n the images directory type "make"
  14. .DE
  15. ou should now have a file named "sample_image" in the directory.  This
  16. mage is a picture of University Walk in Bristol University, UK showing
  17. art of The Queen's Building (Engineering Faculty and home of the
  18. omputer Science Dept.) in the background.
  19. .LP
  20. he screen display facilities of the toolkit only work in 
  21. .I Sunview 
  22. t present, so 
  23. .DS L
  24. ype "suntools" 
  25. .DE
  26. o enter 
  27. .I Sunview 
  28. f you are not already in the windowing enviroment.
  29. .LP
  30. o display the image on the screen of your workstation 
  31. .DS L
  32. ype "dsp sample_image"
  33. .DE
  34. nd the image will be displayed on your screen. THe program dsp checks
  35. o see whether you are running the toolkit on a colour or on a black &
  36. hite Sun Workstation and displays using 256 Greylevels or a dithering
  37. echnique as appropriate. To exit the display program it will have to
  38. e killed by pressing the right mouse button on the top black frame bar
  39. f the image and selecting the "Quit" menu entry.
  40. .LP
  41. o show a histogram of the greylevels present in an image use the "hist"
  42. ommand. For example,
  43. .DS L
  44. ype "hist sample_image"
  45. .DE
  46. o show the histogram plot of the sample image. Some additional data is
  47. ritten to the invoking window (via the standard error stream).
  48. .LP
  49. o convolve the sample image with a linear filter, say a Laplacian
  50. ilter,  and then to display the results
  51. .DS L
  52. ype "convolve -flap1 -e sample_image | dsp"
  53. .DE
  54. he "-f" option states which filter to use and the "-e" option tells
  55. he convolve program to use enhanced scaling on the output. (Basically
  56. his involves another pass over the image to stretch the Greylevel
  57. ange in the output to the maximum available). 
  58. .LP
  59. his command line also demonstrates one of the main design features of
  60. he 
  61. .I ALV 
  62. oolkit - communication between processes via Unix pipes. The
  63. "|" symbol above connects the ouput of the "convolve" command (the
  64. onvolved image) with the input of the "dsp" command with the net
  65. esult of dislaying the convolved image on the screen. Most of the
  66. oolkit's commands can be joined together like this and there is no
  67. (theoretical) limit to the number of commands that can be linked in this
  68. ay. For example, typing 
  69. .DS L
  70. "convolve -fxdiff1 -e sample_image | rasrange -l64 -h192 | rasscale -s0.5 | dsp"
  71. .DE
  72. auses the sample image to be convolved with a 5*5 X-differentiating
  73. inear filter with enhanced scaling, then ranged so that what was
  74. reylevel 64 becomes greylevel 0 and what was greylevel 192 becomes
  75. reylevel 255, scaled to half size and then
  76. isplayed on the screen. Far more complex piplines than this can be
  77. onstructed! For further information about using the commands consult the 
  78. .I ALV
  79. ommand manual pages. 
  80. .LP
  81. f you wish to construct your own tools, the file 
  82. .I src/generic.c
  83. ay be usefully used as a template. This contains all the code necessary 
  84. or accessing the 
  85. .I ~/.alv_profile ,
  86. or parsing the command-line arguments and for reading the raster into memory.
  87. o compile this requires the files 
  88. .I src/defs.h
  89. nd 
  90. .I src/support.h
  91. ogether with the 
  92. .I pixrect
  93. ibrary
  94. .I lpixrect .
  95. f you do write any other filters which you find useful, please
  96. onsider mailing them to me so that I can redistribute them to other
  97. sers of the toolkit.
  98.